Skip to content

Conditionally build page pruning predicates#21480

Open
fpetkovski wants to merge 3 commits intoapache:mainfrom
fpetkovski:optimize-pruning-predicate
Open

Conditionally build page pruning predicates#21480
fpetkovski wants to merge 3 commits intoapache:mainfrom
fpetkovski:optimize-pruning-predicate

Conversation

@fpetkovski
Copy link
Copy Markdown

@fpetkovski fpetkovski commented Apr 8, 2026

Rationale for this change

Page pruning predicates in the Parquet opener are constructed regardless of whether enable_page_index is set. Under high query load, this uses significant CPU time although these predicates are created and discarded quickly.

Which issue does this PR close?

What changes are included in this PR?

This commit reorders the predicate creation flow to only construct page pruning predicates if enable_page_index is enabled. Regular predicates are created always as before.

Are these changes tested?

I am relying on unit tests but I can do manual testing with a debugger.

Are there any user-facing changes?

Changes are are optimization and are not user-facing.

image

Page pruning predicates in the Parquet opener are constructed regardless of whether enable_page_index is set. Under high query load, this uses significant CPU time although these predicates are created and discarded quickly.

This commit reorders the predicate creation flow to only construct page pruning predicates if enable_page_index is enabled. Regular predicates are created always as before.
@fpetkovski fpetkovski force-pushed the optimize-pruning-predicate branch from cfcc878 to e5905e2 Compare April 8, 2026 19:43
@github-actions github-actions bot added the datasource Changes to the datasource crate label Apr 8, 2026
@alamb alamb added the performance Make DataFusion faster label Apr 8, 2026
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @fpetkovski -- this is a good idea

Do you think there is any way to test this? otherwise we run a real danger of regressing performance under refactors (for example the one I am working on now with #21327

Though it is not clear to me what such a test would look like / how to do it without causing non trivial churn 🤔

@2010YOUY01
Copy link
Copy Markdown
Contributor

This removes a redundant step, and the change looks reasonable. However, I’m curious how this step ends up consuming significant CPU time — building a predicate per file doesn’t seem very expensive. Do you have a micro-benchmark that demonstrates the impact on a representative workload?

@Dandandan
Copy link
Copy Markdown
Contributor

run benchmarks

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4211974826-978-jjwl6 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing optimize-pruning-predicate (e5905e2) to 91c2e04 (merge-base) diff using: tpcds
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4211974826-979-58k86 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing optimize-pruning-predicate (e5905e2) to 91c2e04 (merge-base) diff using: tpch
Results will be posted here when complete


File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark running (GKE) | trigger
Instance: c4a-highmem-16 (12 vCPU / 65 GiB) | Linux bench-c4211974826-977-fjh29 6.12.55+ #1 SMP Sun Feb 1 08:59:41 UTC 2026 aarch64 GNU/Linux

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected

Comparing optimize-pruning-predicate (e5905e2) to 91c2e04 (merge-base) diff using: clickbench_partitioned
Results will be posted here when complete


File an issue against this benchmark runner


// Build predicates for this specific file
let (pruning_predicate, page_pruning_predicate) = build_pruning_predicates(
let pruning_predicate = build_pruning_predicates(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better is to delay it so they are only created after we loaded the page index, this avoids doing it as well for files without page index (and avoids it in short-circuit scenarios / query cancellation).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can help do this as a follow on PR too

@fpetkovski
Copy link
Copy Markdown
Author

fpetkovski commented Apr 9, 2026

Thanks everyone for the review. I will address comments and in the meantime I have attached a profile screenshot from our production in the PR description. We query many small files very frequently (thousands of QPS), which are already pre-filtered outside of datafusion so pruning predicates have little effect. As can be seen, half of query time is spent opening files.

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

Comparing HEAD and optimize-pruning-predicate
--------------------
Benchmark tpcds_sf1.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                     HEAD ┃               optimize-pruning-predicate ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 1  │              7.16 / 7.51 ±0.62 / 8.75 ms │              6.84 / 7.28 ±0.72 / 8.72 ms │     no change │
│ QQuery 2  │        145.82 / 147.36 ±0.84 / 148.33 ms │        144.06 / 145.52 ±0.96 / 147.06 ms │     no change │
│ QQuery 3  │        114.97 / 115.59 ±0.67 / 116.80 ms │        114.56 / 114.76 ±0.19 / 115.03 ms │     no change │
│ QQuery 4  │    1428.63 / 1455.69 ±20.15 / 1480.78 ms │     1411.41 / 1423.45 ±9.75 / 1435.46 ms │     no change │
│ QQuery 5  │        175.03 / 175.86 ±1.02 / 177.79 ms │        172.79 / 175.48 ±2.95 / 181.16 ms │     no change │
│ QQuery 6  │       863.65 / 876.57 ±13.53 / 898.45 ms │       857.48 / 875.52 ±13.81 / 889.56 ms │     no change │
│ QQuery 7  │        345.66 / 348.33 ±1.42 / 349.60 ms │        343.46 / 346.44 ±2.13 / 350.02 ms │     no change │
│ QQuery 8  │        117.25 / 118.94 ±1.35 / 121.25 ms │        114.87 / 117.70 ±1.98 / 120.71 ms │     no change │
│ QQuery 9  │       103.41 / 110.39 ±10.26 / 130.46 ms │        101.57 / 105.86 ±2.28 / 108.08 ms │     no change │
│ QQuery 10 │        106.34 / 108.30 ±1.56 / 110.56 ms │        106.11 / 107.01 ±0.94 / 108.48 ms │     no change │
│ QQuery 11 │     1023.70 / 1032.25 ±9.27 / 1049.49 ms │     987.19 / 1010.79 ±12.80 / 1022.27 ms │     no change │
│ QQuery 12 │           45.96 / 48.53 ±2.42 / 53.05 ms │           46.20 / 47.24 ±0.79 / 48.28 ms │     no change │
│ QQuery 13 │        406.75 / 409.70 ±3.10 / 415.68 ms │        402.78 / 407.57 ±3.02 / 410.85 ms │     no change │
│ QQuery 14 │     1007.83 / 1015.46 ±5.31 / 1023.84 ms │     1005.61 / 1010.73 ±3.43 / 1014.95 ms │     no change │
│ QQuery 15 │           16.06 / 17.13 ±1.01 / 18.99 ms │           16.31 / 17.18 ±0.98 / 19.10 ms │     no change │
│ QQuery 16 │              7.73 / 8.12 ±0.28 / 8.58 ms │              7.46 / 7.64 ±0.14 / 7.86 ms │ +1.06x faster │
│ QQuery 17 │        233.24 / 235.41 ±1.59 / 237.98 ms │        230.39 / 231.31 ±1.12 / 233.46 ms │     no change │
│ QQuery 18 │        129.88 / 130.53 ±0.63 / 131.66 ms │        128.36 / 130.31 ±1.23 / 132.10 ms │     no change │
│ QQuery 19 │        158.03 / 161.10 ±1.73 / 163.07 ms │        154.93 / 158.78 ±2.21 / 161.73 ms │     no change │
│ QQuery 20 │           14.71 / 15.00 ±0.28 / 15.48 ms │           13.97 / 14.84 ±0.62 / 15.57 ms │     no change │
│ QQuery 21 │           20.30 / 20.66 ±0.40 / 21.40 ms │           19.47 / 20.19 ±0.41 / 20.64 ms │     no change │
│ QQuery 22 │        497.69 / 503.84 ±3.58 / 508.48 ms │        489.65 / 494.39 ±4.66 / 501.46 ms │     no change │
│ QQuery 23 │       912.06 / 924.02 ±10.56 / 936.90 ms │       887.19 / 901.37 ±10.94 / 916.18 ms │     no change │
│ QQuery 24 │        392.88 / 395.93 ±2.86 / 400.19 ms │        387.52 / 389.93 ±2.77 / 395.17 ms │     no change │
│ QQuery 25 │        347.80 / 349.02 ±1.42 / 351.72 ms │        345.38 / 347.53 ±3.04 / 353.53 ms │     no change │
│ QQuery 26 │           80.70 / 82.39 ±1.07 / 83.66 ms │           82.12 / 83.90 ±1.39 / 85.61 ms │     no change │
│ QQuery 27 │             7.16 / 8.28 ±1.28 / 10.44 ms │              7.07 / 7.59 ±0.43 / 8.35 ms │ +1.09x faster │
│ QQuery 28 │        150.50 / 151.52 ±0.60 / 152.13 ms │        150.63 / 152.31 ±1.81 / 155.23 ms │     no change │
│ QQuery 29 │        284.53 / 286.42 ±1.38 / 288.67 ms │        281.44 / 284.49 ±1.67 / 286.01 ms │     no change │
│ QQuery 30 │           43.40 / 44.37 ±0.77 / 45.42 ms │           44.05 / 44.93 ±0.95 / 46.42 ms │     no change │
│ QQuery 31 │        172.69 / 174.39 ±0.98 / 175.37 ms │        170.49 / 172.07 ±1.12 / 173.78 ms │     no change │
│ QQuery 32 │           57.86 / 59.56 ±1.15 / 61.09 ms │           57.56 / 58.70 ±0.64 / 59.51 ms │     no change │
│ QQuery 33 │        142.69 / 143.73 ±0.87 / 145.23 ms │        139.43 / 142.75 ±2.29 / 145.68 ms │     no change │
│ QQuery 34 │              7.04 / 7.39 ±0.30 / 7.95 ms │              6.94 / 7.26 ±0.31 / 7.85 ms │     no change │
│ QQuery 35 │        106.98 / 108.77 ±1.20 / 110.18 ms │        108.46 / 109.23 ±0.68 / 110.29 ms │     no change │
│ QQuery 36 │              6.75 / 6.94 ±0.12 / 7.12 ms │              6.74 / 6.86 ±0.12 / 7.10 ms │     no change │
│ QQuery 37 │              8.66 / 9.02 ±0.31 / 9.44 ms │              8.43 / 8.81 ±0.36 / 9.44 ms │     no change │
│ QQuery 38 │           86.45 / 89.24 ±4.10 / 97.23 ms │           82.65 / 89.28 ±4.58 / 96.81 ms │     no change │
│ QQuery 39 │        126.60 / 129.73 ±1.77 / 132.04 ms │        125.94 / 127.97 ±1.31 / 129.37 ms │     no change │
│ QQuery 40 │        113.44 / 118.09 ±6.54 / 130.95 ms │        111.72 / 115.81 ±5.66 / 126.88 ms │     no change │
│ QQuery 41 │           15.54 / 16.01 ±0.43 / 16.73 ms │           14.84 / 15.97 ±1.12 / 17.95 ms │     no change │
│ QQuery 42 │        109.26 / 110.67 ±1.05 / 112.21 ms │        108.29 / 109.36 ±1.02 / 111.07 ms │     no change │
│ QQuery 43 │              6.08 / 6.24 ±0.14 / 6.48 ms │              6.11 / 6.22 ±0.10 / 6.37 ms │     no change │
│ QQuery 44 │           12.17 / 12.31 ±0.15 / 12.60 ms │           11.86 / 12.37 ±0.62 / 13.59 ms │     no change │
│ QQuery 45 │           51.88 / 52.80 ±0.90 / 54.47 ms │           50.60 / 51.36 ±0.62 / 52.48 ms │     no change │
│ QQuery 46 │              8.73 / 9.02 ±0.18 / 9.21 ms │              8.76 / 8.97 ±0.18 / 9.26 ms │     no change │
│ QQuery 47 │        750.51 / 764.36 ±8.54 / 774.06 ms │        761.26 / 766.05 ±3.69 / 770.39 ms │     no change │
│ QQuery 48 │        292.46 / 295.07 ±1.41 / 296.51 ms │        294.87 / 299.93 ±2.78 / 302.56 ms │     no change │
│ QQuery 49 │        254.75 / 256.21 ±1.47 / 258.81 ms │        255.74 / 257.27 ±1.09 / 258.62 ms │     no change │
│ QQuery 50 │        225.89 / 233.94 ±5.03 / 241.60 ms │        229.45 / 232.82 ±2.58 / 236.82 ms │     no change │
│ QQuery 51 │        181.42 / 184.71 ±3.20 / 188.55 ms │        184.70 / 187.46 ±1.64 / 189.62 ms │     no change │
│ QQuery 52 │        108.04 / 109.40 ±0.85 / 110.51 ms │        109.66 / 111.46 ±1.94 / 114.96 ms │     no change │
│ QQuery 53 │        102.65 / 104.08 ±0.88 / 105.14 ms │        105.16 / 105.71 ±0.70 / 107.01 ms │     no change │
│ QQuery 54 │        147.70 / 148.94 ±0.86 / 150.38 ms │        148.28 / 150.46 ±1.51 / 151.95 ms │     no change │
│ QQuery 55 │        107.37 / 108.90 ±1.03 / 110.39 ms │        108.80 / 110.65 ±1.35 / 112.38 ms │     no change │
│ QQuery 56 │        141.62 / 142.18 ±0.63 / 143.17 ms │        143.30 / 144.21 ±0.88 / 145.75 ms │     no change │
│ QQuery 57 │        172.94 / 175.14 ±1.64 / 177.74 ms │        176.92 / 180.65 ±2.28 / 183.12 ms │     no change │
│ QQuery 58 │        296.77 / 302.85 ±4.93 / 309.93 ms │        295.50 / 302.73 ±4.96 / 309.07 ms │     no change │
│ QQuery 59 │        197.33 / 200.22 ±1.76 / 202.52 ms │        203.43 / 205.03 ±1.30 / 207.05 ms │     no change │
│ QQuery 60 │        144.11 / 145.69 ±0.98 / 146.81 ms │        146.45 / 148.62 ±1.29 / 150.28 ms │     no change │
│ QQuery 61 │           13.40 / 13.62 ±0.25 / 13.96 ms │           13.66 / 13.98 ±0.25 / 14.37 ms │     no change │
│ QQuery 62 │       913.95 / 969.91 ±30.17 / 999.55 ms │       932.56 / 953.47 ±23.07 / 996.07 ms │     no change │
│ QQuery 63 │        103.62 / 106.14 ±2.35 / 109.35 ms │        105.36 / 106.40 ±0.87 / 107.49 ms │     no change │
│ QQuery 64 │        691.68 / 703.56 ±7.04 / 712.11 ms │        699.95 / 703.35 ±2.94 / 708.16 ms │     no change │
│ QQuery 65 │        258.48 / 264.15 ±4.30 / 271.19 ms │        266.38 / 270.62 ±2.60 / 274.38 ms │     no change │
│ QQuery 66 │        238.23 / 252.86 ±9.69 / 265.10 ms │       245.64 / 262.40 ±10.39 / 276.09 ms │     no change │
│ QQuery 67 │        307.86 / 318.21 ±7.40 / 327.02 ms │        325.92 / 329.93 ±3.46 / 335.11 ms │     no change │
│ QQuery 68 │            9.24 / 10.47 ±0.65 / 11.07 ms │           10.48 / 11.62 ±0.90 / 12.93 ms │  1.11x slower │
│ QQuery 69 │        102.54 / 105.10 ±1.85 / 106.94 ms │        104.89 / 106.43 ±1.00 / 107.93 ms │     no change │
│ QQuery 70 │       338.47 / 358.27 ±11.59 / 374.63 ms │       342.39 / 358.24 ±11.14 / 372.64 ms │     no change │
│ QQuery 71 │        137.99 / 139.53 ±1.50 / 141.40 ms │        136.95 / 140.06 ±2.49 / 144.57 ms │     no change │
│ QQuery 72 │       612.41 / 625.27 ±10.01 / 639.98 ms │        619.28 / 629.76 ±9.45 / 647.25 ms │     no change │
│ QQuery 73 │              7.49 / 8.64 ±0.91 / 9.95 ms │              7.22 / 8.29 ±0.62 / 8.88 ms │     no change │
│ QQuery 74 │        631.98 / 635.42 ±3.78 / 640.10 ms │        637.20 / 640.99 ±2.80 / 645.14 ms │     no change │
│ QQuery 75 │        278.77 / 281.18 ±2.17 / 284.73 ms │        279.77 / 282.23 ±2.29 / 285.72 ms │     no change │
│ QQuery 76 │        133.48 / 135.27 ±1.34 / 137.44 ms │        132.27 / 134.16 ±1.15 / 135.43 ms │     no change │
│ QQuery 77 │        189.55 / 191.39 ±1.51 / 193.26 ms │        189.58 / 190.89 ±1.09 / 192.26 ms │     no change │
│ QQuery 78 │        343.30 / 348.87 ±3.62 / 353.62 ms │        344.18 / 349.00 ±4.01 / 353.85 ms │     no change │
│ QQuery 79 │        239.41 / 245.07 ±4.06 / 252.03 ms │        243.29 / 246.31 ±2.18 / 249.43 ms │     no change │
│ QQuery 80 │        323.22 / 324.55 ±1.05 / 325.87 ms │        322.05 / 325.57 ±2.44 / 329.65 ms │     no change │
│ QQuery 81 │           27.37 / 28.48 ±0.86 / 30.02 ms │           26.99 / 28.30 ±0.99 / 29.53 ms │     no change │
│ QQuery 82 │        198.95 / 202.18 ±2.49 / 206.52 ms │        197.61 / 202.67 ±2.94 / 206.17 ms │     no change │
│ QQuery 83 │           39.22 / 40.40 ±0.77 / 41.56 ms │           39.32 / 40.34 ±1.00 / 42.25 ms │     no change │
│ QQuery 84 │           49.04 / 50.10 ±1.10 / 52.20 ms │           49.54 / 50.45 ±0.67 / 51.34 ms │     no change │
│ QQuery 85 │        149.84 / 152.04 ±1.11 / 152.74 ms │        147.36 / 149.44 ±1.28 / 150.59 ms │     no change │
│ QQuery 86 │           39.72 / 40.74 ±0.92 / 42.40 ms │           40.02 / 40.37 ±0.33 / 40.80 ms │     no change │
│ QQuery 87 │           86.72 / 89.86 ±2.88 / 95.00 ms │           85.37 / 89.68 ±3.71 / 96.19 ms │     no change │
│ QQuery 88 │        100.66 / 102.69 ±1.97 / 106.25 ms │        100.81 / 102.23 ±0.93 / 103.32 ms │     no change │
│ QQuery 89 │        120.21 / 121.07 ±0.66 / 122.13 ms │        118.19 / 121.22 ±1.64 / 122.56 ms │     no change │
│ QQuery 90 │           23.78 / 24.24 ±0.27 / 24.54 ms │           24.00 / 24.42 ±0.44 / 25.07 ms │     no change │
│ QQuery 91 │           62.29 / 64.16 ±0.97 / 64.92 ms │           63.96 / 65.59 ±1.04 / 66.85 ms │     no change │
│ QQuery 92 │           58.84 / 59.57 ±0.48 / 60.27 ms │           58.59 / 59.24 ±0.76 / 60.70 ms │     no change │
│ QQuery 93 │        190.40 / 192.45 ±1.52 / 194.77 ms │        191.94 / 192.83 ±0.80 / 194.03 ms │     no change │
│ QQuery 94 │           61.52 / 62.97 ±0.98 / 63.93 ms │           62.58 / 63.15 ±0.60 / 64.10 ms │     no change │
│ QQuery 95 │        128.09 / 129.51 ±1.18 / 131.60 ms │        128.91 / 130.40 ±0.90 / 131.33 ms │     no change │
│ QQuery 96 │           72.54 / 74.62 ±1.56 / 77.34 ms │           74.61 / 75.40 ±0.68 / 76.47 ms │     no change │
│ QQuery 97 │        126.45 / 128.74 ±1.23 / 129.94 ms │        127.25 / 129.61 ±1.47 / 131.89 ms │     no change │
│ QQuery 98 │        156.64 / 159.45 ±1.90 / 161.93 ms │        155.52 / 157.38 ±1.68 / 160.05 ms │     no change │
│ QQuery 99 │ 10813.40 / 10879.93 ±44.79 / 10953.47 ms │ 10820.57 / 10861.37 ±21.40 / 10879.39 ms │     no change │
└───────────┴──────────────────────────────────────────┴──────────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                         ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                         │ 32170.49ms │
│ Total Time (optimize-pruning-predicate)   │ 32075.84ms │
│ Average Time (HEAD)                       │   324.95ms │
│ Average Time (optimize-pruning-predicate) │   324.00ms │
│ Queries Faster                            │          2 │
│ Queries Slower                            │          1 │
│ Queries with No Change                    │         96 │
│ Queries with Failure                      │          0 │
└───────────────────────────────────────────┴────────────┘

Resource Usage

tpcds — base (merge-base)

Metric Value
Wall time 161.2s
Peak memory 5.1 GiB
Avg memory 4.4 GiB
CPU user 265.9s
CPU sys 17.6s
Peak spill 0 B

tpcds — branch

Metric Value
Wall time 160.7s
Peak memory 5.1 GiB
Avg memory 4.4 GiB
CPU user 265.0s
CPU sys 17.8s
Peak spill 0 B

File an issue against this benchmark runner

@adriangbot
Copy link
Copy Markdown

🤖 Benchmark completed (GKE) | trigger

Instance: c4a-highmem-16 (12 vCPU / 65 GiB)

CPU Details (lscpu)
Architecture:                            aarch64
CPU op-mode(s):                          64-bit
Byte Order:                              Little Endian
CPU(s):                                  16
On-line CPU(s) list:                     0-15
Vendor ID:                               ARM
Model name:                              Neoverse-V2
Model:                                   1
Thread(s) per core:                      1
Core(s) per cluster:                     16
Socket(s):                               -
Cluster(s):                              1
Stepping:                                r0p1
BogoMIPS:                                2000.00
Flags:                                   fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti
L1d cache:                               1 MiB (16 instances)
L1i cache:                               1 MiB (16 instances)
L2 cache:                                32 MiB (16 instances)
L3 cache:                                80 MiB (1 instance)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-15
Vulnerability Gather data sampling:      Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Not affected
Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
Vulnerability Spectre v2:                Mitigation; CSV2, BHB
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Not affected
Details

Comparing HEAD and optimize-pruning-predicate
--------------------
Benchmark clickbench_partitioned.json
--------------------
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query     ┃                                  HEAD ┃            optimize-pruning-predicate ┃        Change ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ QQuery 0  │          1.20 / 4.40 ±6.31 / 17.03 ms │          1.23 / 4.41 ±6.30 / 17.02 ms │     no change │
│ QQuery 1  │        14.04 / 14.54 ±0.29 / 14.94 ms │        14.36 / 15.99 ±1.92 / 19.49 ms │  1.10x slower │
│ QQuery 2  │        43.68 / 45.48 ±1.23 / 47.18 ms │        43.71 / 44.04 ±0.21 / 44.36 ms │     no change │
│ QQuery 3  │        41.04 / 44.41 ±1.75 / 46.11 ms │        40.30 / 45.02 ±3.69 / 49.57 ms │     no change │
│ QQuery 4  │     284.78 / 294.11 ±9.61 / 312.68 ms │     285.89 / 289.62 ±2.45 / 293.57 ms │     no change │
│ QQuery 5  │     337.72 / 341.18 ±2.35 / 344.65 ms │     338.55 / 341.80 ±1.89 / 343.84 ms │     no change │
│ QQuery 6  │           5.51 / 6.07 ±0.64 / 7.27 ms │           4.95 / 5.87 ±0.78 / 6.99 ms │     no change │
│ QQuery 7  │        16.41 / 16.79 ±0.38 / 17.49 ms │        16.36 / 16.68 ±0.29 / 17.13 ms │     no change │
│ QQuery 8  │    402.90 / 414.85 ±11.47 / 435.06 ms │     406.83 / 412.60 ±5.20 / 419.37 ms │     no change │
│ QQuery 9  │     623.25 / 633.00 ±7.87 / 645.89 ms │     625.24 / 635.06 ±6.16 / 641.83 ms │     no change │
│ QQuery 10 │        90.12 / 92.09 ±3.37 / 98.78 ms │        89.01 / 91.41 ±3.32 / 97.88 ms │     no change │
│ QQuery 11 │     101.30 / 102.43 ±1.35 / 104.77 ms │     102.38 / 103.05 ±0.58 / 103.74 ms │     no change │
│ QQuery 12 │     332.58 / 340.18 ±4.63 / 346.66 ms │     334.47 / 337.93 ±2.78 / 342.02 ms │     no change │
│ QQuery 13 │    448.37 / 471.45 ±24.80 / 503.82 ms │    458.09 / 478.95 ±14.20 / 496.19 ms │     no change │
│ QQuery 14 │     336.68 / 342.14 ±2.79 / 344.45 ms │     338.18 / 345.74 ±4.98 / 352.56 ms │     no change │
│ QQuery 15 │    350.27 / 363.54 ±18.55 / 398.75 ms │    350.92 / 387.67 ±21.13 / 412.26 ms │  1.07x slower │
│ QQuery 16 │    716.93 / 736.37 ±12.68 / 755.82 ms │     709.08 / 715.11 ±3.27 / 718.75 ms │     no change │
│ QQuery 17 │     697.74 / 705.15 ±5.00 / 711.62 ms │     696.75 / 703.55 ±5.17 / 709.76 ms │     no change │
│ QQuery 18 │ 1416.68 / 1475.75 ±37.29 / 1515.43 ms │  1355.82 / 1366.69 ±7.46 / 1375.23 ms │ +1.08x faster │
│ QQuery 19 │        34.50 / 35.77 ±1.58 / 38.88 ms │        35.22 / 36.65 ±1.47 / 39.40 ms │     no change │
│ QQuery 20 │    721.57 / 740.19 ±23.19 / 777.78 ms │     717.11 / 726.30 ±7.47 / 738.70 ms │     no change │
│ QQuery 21 │     761.26 / 766.45 ±5.88 / 777.28 ms │     765.77 / 767.62 ±1.36 / 769.30 ms │     no change │
│ QQuery 22 │  1128.67 / 1134.03 ±4.79 / 1140.08 ms │  1128.70 / 1134.53 ±4.46 / 1141.32 ms │     no change │
│ QQuery 23 │ 3063.33 / 3090.19 ±21.25 / 3121.04 ms │ 3051.98 / 3065.20 ±14.26 / 3084.86 ms │     no change │
│ QQuery 24 │      99.57 / 102.69 ±2.10 / 106.15 ms │       96.72 / 99.90 ±2.52 / 103.28 ms │     no change │
│ QQuery 25 │     135.99 / 139.62 ±2.41 / 142.87 ms │     139.43 / 140.31 ±0.88 / 141.68 ms │     no change │
│ QQuery 26 │      96.35 / 100.43 ±2.58 / 103.20 ms │      98.78 / 101.30 ±1.66 / 103.93 ms │     no change │
│ QQuery 27 │     847.25 / 853.89 ±4.41 / 858.09 ms │     850.22 / 854.10 ±3.15 / 857.92 ms │     no change │
│ QQuery 28 │ 7679.90 / 7759.15 ±40.03 / 7787.29 ms │ 7691.77 / 7749.65 ±33.89 / 7791.86 ms │     no change │
│ QQuery 29 │        51.26 / 57.48 ±8.94 / 75.01 ms │        50.46 / 55.05 ±7.00 / 68.96 ms │     no change │
│ QQuery 30 │    353.56 / 363.44 ±10.90 / 383.84 ms │     358.21 / 364.76 ±6.17 / 376.17 ms │     no change │
│ QQuery 31 │    357.68 / 375.31 ±16.98 / 395.90 ms │    353.22 / 372.08 ±14.77 / 395.97 ms │     no change │
│ QQuery 32 │ 1025.91 / 1049.28 ±31.04 / 1110.34 ms │  1033.23 / 1043.13 ±9.59 / 1059.41 ms │     no change │
│ QQuery 33 │  1445.05 / 1454.96 ±6.97 / 1464.98 ms │  1442.80 / 1458.68 ±9.46 / 1470.42 ms │     no change │
│ QQuery 34 │ 1426.47 / 1441.83 ±10.70 / 1453.83 ms │ 1449.84 / 1479.60 ±19.17 / 1509.48 ms │     no change │
│ QQuery 35 │     376.07 / 382.71 ±5.95 / 390.56 ms │     381.57 / 387.67 ±7.56 / 402.10 ms │     no change │
│ QQuery 36 │     112.40 / 118.72 ±3.39 / 122.23 ms │     113.09 / 120.24 ±4.39 / 125.04 ms │     no change │
│ QQuery 37 │        49.07 / 49.97 ±0.77 / 50.85 ms │        46.69 / 49.74 ±2.03 / 52.98 ms │     no change │
│ QQuery 38 │        75.57 / 76.82 ±1.10 / 78.45 ms │        74.70 / 76.18 ±1.30 / 78.01 ms │     no change │
│ QQuery 39 │     208.01 / 213.64 ±5.54 / 223.85 ms │     210.92 / 218.02 ±6.12 / 227.07 ms │     no change │
│ QQuery 40 │        25.14 / 26.20 ±0.96 / 27.97 ms │        22.69 / 25.71 ±2.66 / 29.27 ms │     no change │
│ QQuery 41 │        18.77 / 20.79 ±3.31 / 27.39 ms │        19.29 / 21.06 ±2.03 / 24.93 ms │     no change │
│ QQuery 42 │        18.23 / 19.25 ±0.70 / 20.25 ms │        19.60 / 19.81 ±0.26 / 20.31 ms │     no change │
└───────────┴───────────────────────────────────────┴───────────────────────────────────────┴───────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Benchmark Summary                         ┃            ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ Total Time (HEAD)                         │ 26816.72ms │
│ Total Time (optimize-pruning-predicate)   │ 26708.49ms │
│ Average Time (HEAD)                       │   623.64ms │
│ Average Time (optimize-pruning-predicate) │   621.13ms │
│ Queries Faster                            │          1 │
│ Queries Slower                            │          2 │
│ Queries with No Change                    │         40 │
│ Queries with Failure                      │          0 │
└───────────────────────────────────────────┴────────────┘

Resource Usage

clickbench_partitioned — base (merge-base)

Metric Value
Wall time 135.3s
Peak memory 42.6 GiB
Avg memory 30.1 GiB
CPU user 1283.1s
CPU sys 86.2s
Peak spill 0 B

clickbench_partitioned — branch

Metric Value
Wall time 134.6s
Peak memory 39.7 GiB
Avg memory 33.3 GiB
CPU user 1284.7s
CPU sys 82.3s
Peak spill 0 B

File an issue against this benchmark runner

@alamb
Copy link
Copy Markdown
Contributor

alamb commented Apr 9, 2026

Maybe the predicate is complex 🤔

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t


// Build predicates for this specific file
let (pruning_predicate, page_pruning_predicate) = build_pruning_predicates(
let pruning_predicate = build_pruning_predicates(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can help do this as a follow on PR too

@alamb
Copy link
Copy Markdown
Contributor

alamb commented Apr 9, 2026

We need to clean up CI and ideally find some sort of tests for this, but I think it is an improvement over main -- thank you @fpetkovski

@adriangb
Copy link
Copy Markdown
Contributor

adriangb commented Apr 9, 2026

One thing I wonder is if we can avoid per-file rewrites, pruning predicate creation, etc. by caching these things. In most systems you might have 2-3 different physical schemas (different writers, etc.) but often times just 1 so re-doing the exact same work across many files is wasteful.

@fpetkovski
Copy link
Copy Markdown
Author

fpetkovski commented Apr 9, 2026

I've added a test which should verify the pruning functionality. When we disable the page index we get back all the rows, with the index enabled we only get back the page which matches the predicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate performance Make DataFusion faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants